import * as types from './mutation-types'

export default {
  [types.UPDATE_SLIDE](state, payload) {
    let datas = []

    let idxs = state.roles[payload.user_type];

    if (!!idxs && idxs.length > 0) {
      idxs.forEach((v) => {
        datas.push(state.lists[v])
      });
    }
    state.current_slides = datas
  },
}